package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.EnclosureInfoMapper;
import com.ruoyi.system.domain.EnclosureInfo;
import com.ruoyi.system.service.IEnclosureInfoService;

/**
 * 围栏信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-11
 */
@Service
public class EnclosureInfoServiceImpl implements IEnclosureInfoService 
{
    @Autowired
    private EnclosureInfoMapper enclosureInfoMapper;

    /**
     * 查询围栏信息
     * 
     * @param id 围栏信息主键
     * @return 围栏信息
     */
    @Override
    public EnclosureInfo selectEnclosureInfoById(Long id)
    {
        return enclosureInfoMapper.selectEnclosureInfoById(id);
    }

    /**
     * 查询围栏信息
     *
     * @return 围栏信息
     */
    @Override
    public EnclosureInfo selectEnclosureBySynId(Integer enclosureId)
    {
        EnclosureInfo search = new EnclosureInfo();
        search.setSynId(enclosureId);
        List<EnclosureInfo> list = enclosureInfoMapper.selectEnclosureInfoList(search);
        return list!=null && list.size()>0 ? list.get(0) : null;
    }

    /**
     * 查询围栏信息列表
     * 
     * @param enclosureInfo 围栏信息
     * @return 围栏信息
     */
    @Override
    public List<EnclosureInfo> selectEnclosureInfoList(EnclosureInfo enclosureInfo)
    {
        return enclosureInfoMapper.selectEnclosureInfoList(enclosureInfo);
    }

    /**
     * 新增围栏信息
     * 
     * @param enclosureInfo 围栏信息
     * @return 结果
     */
    @Override
    public int insertEnclosureInfo(EnclosureInfo enclosureInfo)
    {
        return enclosureInfoMapper.insertEnclosureInfo(enclosureInfo);
    }

    /**
     * 修改围栏信息
     * 
     * @param enclosureInfo 围栏信息
     * @return 结果
     */
    @Override
    public int updateEnclosureInfo(EnclosureInfo enclosureInfo)
    {
        return enclosureInfoMapper.updateEnclosureInfo(enclosureInfo);
    }

    /**
     * 批量删除围栏信息
     * 
     * @param ids 需要删除的围栏信息主键
     * @return 结果
     */
    @Override
    public int deleteEnclosureInfoByIds(Long[] ids)
    {
        return enclosureInfoMapper.deleteEnclosureInfoByIds(ids);
    }

    /**
     * 删除围栏信息信息
     * 
     * @param id 围栏信息主键
     * @return 结果
     */
    @Override
    public int deleteEnclosureInfoById(Long id)
    {
        return enclosureInfoMapper.deleteEnclosureInfoById(id);
    }
}
